/**
 * 消息提示框
 * @type {{methods: {warnMessage(*=, *=): void, message(*=, *=, *): void, successMessage(*=, *=): void, infoMessage(*=, *=): void}}}
 */
export const MessageMixins = {
    methods: {
        message(message, type, cb) {
            this.$message({
                message: message,
                type: type
            });
            if (typeof (cb) == "function") {
                cb();
            }
        },
        successMessage(message, cb) {
            this.message(message, "success", cb);
        },
        infoMessage(message, cb) {
            this.message(message, "info", cb);
        },
        warnMessage(message, cb) {
            this.message(message, "warn", cb);
        },
        errorMessage(message, cb) {
            this.message(message, "error", cb);
        }
    }
}
